<template>
  <div>
    <!-- <button @click="fn">按钮</button> -->
    <!-- <button @click="fn1">登录</button> -->
    <router-view></router-view>
  </div>
</template>

<script>
import request from '@/utils/request'
import { setToken } from '@/utils/storage'
export default {
  data() {
    return {}
  },
  methods: {
    // async fn() {
    //   const res = await request({
    //     method: 'POST',
    //     url: '/user/register',
    //     data: {
    //       username: 'maxatsg',
    //       password: '123456'
    //     }
    //   })
    //   console.log(res)
    // }
    async fn1() {
      const res = await request({
        method: 'POST',
        url: '/user/login',
        data: {
          username: 'maxatsg',
          password: '123456'
        }
      })
      setToken(res.data.token)
      console.log(res)
    }
  }
}
</script>

<style scoped lang="less"></style>
